package com.javaee.ejb.entity;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Date;
import java.util.Set;


/**
 * The persistent class for the employee database table.
 * 
 */
@Entity
@Table(name="employee")
@NamedQueries(
{
	@NamedQuery(name = "FindAllEmployees", query = "SELECT OBJECT (em) FROM Employee em"),
    @NamedQuery(name = "FindEmployeeByUsername", query = "SELECT OBJECT (em) FROM Employee em WHERE em.username = :p_Username"),
    @NamedQuery(name = "FindEmployeeFromUsernamePassword", query = "SELECT OBJECT (em) FROM Employee em WHERE em.username = :p_username AND em.password = :p_password"),
    @NamedQuery(name = "FindEmployeeById", query = "SELECT OBJECT (em) FROM Employee em WHERE em.idemployee = :p_UserId"),
		
			
})
public class Employee implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private int idemployee;

    @Temporal( TemporalType.DATE)
	private Date birthdate;

	private String email;

	private String firstname;

    @Temporal( TemporalType.TIMESTAMP)
	private Date indate;

	private String lastname;

	private String password;

    @Lob()
	private byte[] picture;

	private String username;

	//bi-directional many-to-one association to Conversation
	//@OneToMany(mappedBy="employee1")
	//private Set<Conversation> conversations1;

	//bi-directional many-to-one association to Conversation
	//@OneToMany(mappedBy="employee2")
	//private Set<Conversation> conversations2;

	//bi-directional many-to-one association to Message
//	@OneToMany(mappedBy="employee")
//	private Set<Message> messages;

    public Employee() {
    }

	public int getIdemployee() {
		return this.idemployee;
	}

	public void setIdemployee(int idemployee) {
		this.idemployee = idemployee;
	}

	public Date getBirthdate() {
		return this.birthdate;
	}

	public void setBirthdate(Date birthdate) {
		this.birthdate = birthdate;
	}

	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getFirstname() {
		return this.firstname;
	}

	public void setFirstname(String firstname) {
		this.firstname = firstname;
	}

	public Date getIndate() {
		return this.indate;
	}

	public void setIndate(Date indate) {
		this.indate = indate;
	}

	public String getLastname() {
		return this.lastname;
	}

	public void setLastname(String lastname) {
		this.lastname = lastname;
	}

	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public byte[] getPicture() {
		return this.picture;
	}

	public void setPicture(byte[] picture) {
		this.picture = picture;
	}

	public String getUsername() {
		return this.username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

//	public Set<Conversation> getConversations1() {
//		return this.conversations1;
//	}
//
//	public void setConversations1(Set<Conversation> conversations1) {
//		this.conversations1 = conversations1;
//	}
//	
//	public Set<Conversation> getConversations2() {
//		return this.conversations2;
//	}
//
//	public void setConversations2(Set<Conversation> conversations2) {
//		this.conversations2 = conversations2;
//	}
	
//	public Set<Message> getMessages() {
//		return this.messages;
//	}
//
//	public void setMessages(Set<Message> messages) {
//		this.messages = messages;
//	}
	
}